<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>物料管理</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/treeview.jsp" %>
	<link rel="stylesheet" type="text/css"
		href="${ctxStatic}/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css"
		href="${ctxStatic}/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css"
		href="${ctxStatic}/easyui/demo/demo.css">
	<script type="text/javascript" src="${ctxStatic}/easyui/jquery.min.js"></script>
	<script type="text/javascript"
		src="${ctxStatic}/easyui/jquery.easyui.min.js"></script>
	<style type="text/css">
		.ztree {overflow:auto;margin:0;_margin-top:10px;padding:10px 0 0 10px;}
	</style>
</head>
<body>
	<sys:message content="${message}"/>
	<div id="content" class="row-fluid">
		<div id="left" class="accordion-group">
			<div class="accordion-heading">
		    	<a class="accordion-toggle">物品类别<i class="icon-refresh pull-right" onclick="refreshTree();"></i></a>
		    </div>
			<ul id="ztree" class="ztree"></ul>
		</div>
		<div id="openClose" class="close">&nbsp;</div>
		<div id="right">
			<iframe id="statisticsContent" src="${ctx}/erp/goodsType/toQueryGoods" width="100%" height="91%" frameborder="0"></iframe>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			refreshTree();
		});
		function refreshTree(){
			$('#ztree').tree({
		    	url:'${ctx}/erp/goodsType/treeData',
		    	onClick: function(node){
		    		var parentNode = $('#ztree').tree('getParent',node.target);//获取父节点属性
		    		var parentId='';
		    		if(null!=parentNode){
		    			parentId=parentNode.id;
		    		}
					var id=node.id;
					$('#statisticsContent').attr("src","${ctx}/erp/goodsType/materialManage?typeId="+id+"&typeName="+node.text+"&parentId="+parentId);
				}
		    });
		}
		 
		var leftWidth = 180; // 左侧窗口大小
		var htmlObj = $("html"), mainObj = $("#main");
		var frameObj = $("#left, #openClose, #right, #right iframe");
		function wSize(){
			var strs = getWindowSize().toString().split(",");
			htmlObj.css({"overflow-x":"hidden", "overflow-y":"hidden"});
			mainObj.css("width","auto");
			frameObj.height(strs[0] - 5);
			var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
			$("#right").width($("#content").width()- leftWidth - $("#openClose").width() -5);
			$(".ztree").width(leftWidth - 10).height(frameObj.height() - 46);
		}
	</script>
	<script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>
</body>
</html>